Skip to content

Experiment: Add breakpoint mvp#404

Open
philipp-seitz wants to merge 12 commits intomainfrom
exp/breakpoint
Open

Experiment: Add breakpoint mvp#404
philipp-seitz wants to merge 12 commits intomainfrom
exp/breakpoint

Conversation

@philipp-seitz
Copy link
Collaborator

Run once with:

    storage.clean_graph_files()
    run_graph(storage, executor, graph, graph_inputs={"value": 1})
    # resume_graph(storage, executor)
    # print(read_outputs(graph, storage))

then after

    # storage.clean_graph_files()
    # run_graph(storage, executor, graph, graph_inputs={"value": 1})
    resume_graph(storage, executor)
    print(read_outputs(graph, storage))

@philipp-seitz philipp-seitz marked this pull request as ready for review March 19, 2026 15:55

### Debug Mode

If you want to debug a graph with a python debugger you can use [](#tierkreis.controller.storgare.debug_graph.debug_graph).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need something in this [] part of the link?

inputs_ready: list[NodeRunData]
started: list[Loc]
errored: list[Loc] = Field(default_factory=list[Loc])
breaks: Loc | None = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it significant that breaks is a single Loc rather than a list of them?

and therefore can be started.
started (list[Loc]): A list of locations that have been started (on this walk).
errored (list[Loc]): A list of locations that have encountered an error.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

breaks might need to be added to the docstring?

self,
inputs_type: type[Inputs] = EmptyModel,
outputs_type: type[Outputs] = EmptyModel,
breakpoints_on_inputs: bool = False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if these would be better as setters and getters, the reason being that they would be easier to comment out in code if the user wants to turn them on/off

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree but this would only work for ouptuts as inputs are set in the init.
Once we use the "compile" way we could change this

if not storage.is_node_started(loc):
# have all inputs, start current node
return WalkResult([node_run_data], [])
if idx in graph.node_metadata and graph.node_metadata[idx].has_breakpoint:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Traversing backwards from the outputs means that we will hit breakpoints before nodes that have run, which I don't think is quite what we want.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I double checked the logic is actually correct, the test also covers this case now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants